package com.fgchen.mapper.study01;

import com.fgchen.domain.study01.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Collection;

/**
 * Created by Administrator on 2018-04-08.
 */
public interface UserMapper {

    @Select("select * from users")
    Collection<User> findAll();

    @Select("select * from users where id = #{id}")
    User get(@Param("id") Long id);

    @Insert("insert into users(name, age) values (#{name}, #{age})")
    int insert(@Param("name") String name, @Param("age") Integer age);

}
